#include "window_scroll_menu.h"
#include "window_manager.h"
#include "lv_math.h"
static  lv_obj_t *  BP_img=NULL;
static	lv_obj_t *  message_img=NULL;
static  lv_obj_t *  Calculator_img=NULL;
static  lv_obj_t *  weather_img=NULL ;
static  lv_obj_t *  phone_img=NULL ;

static  lv_obj_t *  music_img=NULL ;
static  lv_obj_t *  sleep_img=NULL ;
static  lv_obj_t *  o2_img=NULL ;

static  lv_obj_t *  stop_watch_img=NULL ;
static  lv_obj_t *  outdoor_sport_img=NULL ;
static  lv_obj_t *  hr_img=NULL ;
   
	 


//int xpos=0,ypos=0;
//顺时针
const unsigned int bp_pos[][2]={
#if 0	
{140, 0},
{116,2},
{92,8},
{70,18},
{50,32},
{33,49},
{19,69},
{9,91},
{2,114},
{0,138},
{2,162},
{8,186},
{18,208},
{32,228},
{49,245},
{69,259},
{91,270},
{114,277},
{138,279},
{162,277},
{185,271},
{207,261},
{227,248},
{244,231},
{258,212},
{269,190},
{276,167},
{279,143},
{277,119},
{271,96},
{261,74},
{248,54},
{231,37},
{212,23},
{191,12},
{168,5},
{144,2},
#else
{140,0},
{164,2},
{188,8},
{210,18},
{230,32},
{247,49},
{261,69},
{271,91},
{278,114},
{280,138},
{278,162},
{272,186},
{262,208},
{248,228},
{231,245},
{211,259},
{189,270},
{166,277},
{142,279},
{118,277},
{95,271},
{73,261},
{53,248},
{36,231},
{22,212},
{11,190},
{4,167},
{1,143},
{3,119},
{9,96},
{19,74},
{32,54},
{49,37},
{68,23},
{89,12},
{112,5},
{136,2},

#endif


//{140,0},
//{166,1},
//{191,6},
//{215,16},
//{237,30},
//{256,47},
//{272,67},
//{284,90},
//{292,114},
//{296,140},
//{295,166},
//{290,191},
//{280,215},
//{266,237},
//{249,256},
//{229,272},
//{206,284},
//{182,292},
//{156,296},
//{130,295},
//{105,290},
//{81,280},
//{59,266},
//{40,249},
//{24,229},
//{12,206},
//{4,182},
//{0,156},
//{1,130},
//{6,105},
//{16,81},
//{30,59},
//{47,40},
//{67,24},
//{90,12},
//{114,4},
//{140,0},
//{166,1},
//{191,6},
//{215,16},
//{237,30},
//{256,47},
//{272,67},
//{284,90},
//{292,114},
//{296,140},
//{295,166},
//{290,191},
//{280,215},
//{266,237},
//{249,256},
//{229,272},
//{206,284},
//{182,292},
//{156,296},
//{130,295},
//{105,290},
//{81,280},
//{59,266},
//{40,249},
//{24,229},
//{12,206},
//{4,182},
//{0,156},
//{1,130},
//{6,105},
//{16,81},
//{30,59},
//{47,40},
//{67,24},
//{90,12},
//{114,4},
//{140,0},
};

const unsigned int message_pos[][2]={
{280,140},
{278,116},
{272,92},
{262,70},
{248,50},
{231,33},
{211,19},
{189,9},
{166,2},
{142,0},
{118,2},
{94,8},
{72,18},
{52,32},
{35,49},
{21,69},
{10,91},
{3,114},
{1,138},
{3,162},
{9,185},
{19,207},
{32,227},
{49,244},
{68,258},
{90,269},
{113,276},
{137,279},
{161,277},
{184,271},
{206,261},
{226,248},
{243,231},
{257,212},
{268,191},
{275,168},
{278,144},
};



static lv_timer_t * timer = NULL;  //设置定时器

static int flag=0;


 static uint8_t Current_index=0;          //记录当前的变量
 static lv_point_t vect=           {0};  //记录当前的坐标
 static lv_point_t history_vect[3]={0};  //记录上一次的坐标
		

	
	
	
	


		






static void my_timer(lv_timer_t * timer)
{
	#if 1
	lv_obj_set_pos(BP_img,						bp_pos[(flag+0*4)>36?(flag+0*4 -36):flag+0*4][0],bp_pos[(flag+0*4)>36?(flag+0*4 -36):flag+0*4][1]);
	lv_obj_set_pos(message_img,				bp_pos[(flag+1*4)>36?(flag+1*4 -36):flag+1*4][0],bp_pos[(flag+1*4)>36?(flag+1*4 -36):flag+1*4][1]);
	lv_obj_set_pos(Calculator_img,		bp_pos[(flag+2*4)>36?(flag+2*4 -36):flag+2*4][0],bp_pos[(flag+2*4)>36?(flag+2*4 -36):flag+2*4][1]);
	lv_obj_set_pos(phone_img,					bp_pos[(flag+3*4)>36?(flag+3*4 -36):flag+3*4][0],bp_pos[(flag+3*4)>36?(flag+3*4 -36):flag+3*4][1]);
	lv_obj_set_pos(weather_img,				bp_pos[(flag+4*4)>36?(flag+4*4 -36):flag+4*4][0],bp_pos[(flag+4*4)>36?(flag+4*4 -36):flag+4*4][1]);
	lv_obj_set_pos(music_img,					bp_pos[(flag+5*4)>36?(flag+5*4 -36):flag+5*4][0],bp_pos[(flag+5*4)>36?(flag+5*4 -36):flag+5*4][1]);
	lv_obj_set_pos(stop_watch_img,		bp_pos[(flag+6*4)>36?(flag+6*4 -36):flag+6*4][0],bp_pos[(flag+6*4)>36?(flag+6*4 -36):flag+6*4][1]);
	lv_obj_set_pos(outdoor_sport_img,	bp_pos[(flag+7*4)>36?(flag+7*4 -36):flag+7*4][0],bp_pos[(flag+7*4)>36?(flag+7*4 -36):flag+7*4][1]);
	lv_obj_set_pos(hr_img,						bp_pos[(flag+8*4)>36?(flag+8*4 -36):flag+8*4][0],bp_pos[(flag+8*4)>36?(flag+8*4 -36):flag+8*4][1]);
	#else
	lv_obj_set_pos(BP_img,						bp_pos[(flag+0*4)>72?(flag+0*4 -72):flag+0*4][0],bp_pos[(flag+0*4)>72?(flag+0*4 -72):flag+0*4][1]);
	lv_obj_set_pos(message_img,				bp_pos[(flag+1*4)>72?(flag+1*4 -72):flag+1*4][0],bp_pos[(flag+1*4)>72?(flag+1*4 -72):flag+1*4][1]);
	lv_obj_set_pos(Calculator_img,		bp_pos[(flag+2*4)>72?(flag+2*4 -72):flag+2*4][0],bp_pos[(flag+2*4)>72?(flag+2*4 -72):flag+2*4][1]);
	lv_obj_set_pos(phone_img,					bp_pos[(flag+3*4)>72?(flag+3*4 -72):flag+3*4][0],bp_pos[(flag+3*4)>72?(flag+3*4 -72):flag+3*4][1]);
	lv_obj_set_pos(weather_img,				bp_pos[(flag+4*4)>72?(flag+4*4 -72):flag+4*4][0],bp_pos[(flag+4*4)>72?(flag+4*4 -72):flag+4*4][1]);
	lv_obj_set_pos(music_img,					bp_pos[(flag+5*4)>72?(flag+5*4 -72):flag+5*4][0],bp_pos[(flag+5*4)>72?(flag+5*4 -72):flag+5*4][1]);
	lv_obj_set_pos(stop_watch_img,		bp_pos[(flag+6*4)>72?(flag+6*4 -72):flag+6*4][0],bp_pos[(flag+6*4)>72?(flag+6*4 -72):flag+6*4][1]);
	lv_obj_set_pos(outdoor_sport_img,	bp_pos[(flag+7*4)>72?(flag+7*4 -72):flag+7*4][0],bp_pos[(flag+7*4)>72?(flag+7*4 -72):flag+7*4][1]);
	lv_obj_set_pos(hr_img,						bp_pos[(flag+8*4)>72?(flag+8*4 -72):flag+8*4][0],bp_pos[(flag+8*4)>72?(flag+8*4 -72):flag+8*4][1]);
	
	
	#endif
	flag++;
	if(flag>=36)
	{
	  flag=0;
	}
}



void start_scroll_timer()
{

    lv_indev_t * indev = lv_indev_get_act(); //获取当前的坐标
    if(indev == NULL)
		{
			printf("null\r\n");
			memset(&history_vect,0x00,sizeof(lv_point_t) *3 );
			return;
		}
		
	  //lv_indev_get_vect(indev, &vect);//获取当前移动向量
		lv_indev_get_point(indev, &vect);//获取当前的坐标
		
   lv_coord_t x =0;
   lv_coord_t y=0;
	
	 lv_coord_t  current_result; //计算当前的结果
		
		
		memcpy(&history_vect[Current_index],& vect,sizeof(lv_point_t) );
		Current_index++;
		if(Current_index >= 3)  //计算当前的滑动方向
		{
		  current_result=  ((history_vect[1].x -history_vect[0].x)*(history_vect[2].y -history_vect[1].y) ) -  ((history_vect[2].x -history_vect[1].x)*(history_vect[1].y -history_vect[0].y) ) ;
			memset(&history_vect,0x00,sizeof(lv_point_t)*3 );

			if(current_result>0)
			{
				flag++;	
			//顺时针
				printf("shun\r\n");
			}else
			{
			//逆时针
				flag--;	
				printf("ni\r\n");
				
			}
			
		}
		Current_index%=3;
		
		//lv_indev_wait_release(indev); //等待释放
			
	//lv_obj_set_pos(BP_img,bp_pos[0][0]        +vect.x		,bp_pos[0][1]  +vect.y);	
	//lv_obj_set_pos(message_img,bp_pos[4][0]   +vect.x		,bp_pos[4][1]  +vect.y);
	//lv_obj_set_pos(Calculator_img,bp_pos[8][0]+vect.x   ,bp_pos[8][1]  +vect.y);
	//lv_obj_set_pos(phone_img,bp_pos[12][0]    +vect.x		,bp_pos[12][1] +vect.y);
		

	lv_obj_set_pos(BP_img,						bp_pos[(flag+0*4)>36?(flag+0*4 -36):flag+0*4][0],bp_pos[(flag+0*4)>36?(flag+0*4 -36):flag+0*4][1]);
	lv_obj_set_pos(message_img,				bp_pos[(flag+1*4)>36?(flag+1*4 -36):flag+1*4][0],bp_pos[(flag+1*4)>36?(flag+1*4 -36):flag+1*4][1]);
	lv_obj_set_pos(Calculator_img,		bp_pos[(flag+2*4)>36?(flag+2*4 -36):flag+2*4][0],bp_pos[(flag+2*4)>36?(flag+2*4 -36):flag+2*4][1]);
	lv_obj_set_pos(phone_img,					bp_pos[(flag+3*4)>36?(flag+3*4 -36):flag+3*4][0],bp_pos[(flag+3*4)>36?(flag+3*4 -36):flag+3*4][1]);
	lv_obj_set_pos(weather_img,				bp_pos[(flag+4*4)>36?(flag+4*4 -36):flag+4*4][0],bp_pos[(flag+4*4)>36?(flag+4*4 -36):flag+4*4][1]);
	lv_obj_set_pos(music_img,					bp_pos[(flag+5*4)>36?(flag+5*4 -36):flag+5*4][0],bp_pos[(flag+5*4)>36?(flag+5*4 -36):flag+5*4][1]);
	lv_obj_set_pos(stop_watch_img,		bp_pos[(flag+6*4)>36?(flag+6*4 -36):flag+6*4][0],bp_pos[(flag+6*4)>36?(flag+6*4 -36):flag+6*4][1]);
	lv_obj_set_pos(outdoor_sport_img,	bp_pos[(flag+7*4)>36?(flag+7*4 -36):flag+7*4][0],bp_pos[(flag+7*4)>36?(flag+7*4 -36):flag+7*4][1]);
	lv_obj_set_pos(hr_img,						bp_pos[(flag+8*4)>36?(flag+8*4 -36):flag+8*4][0],bp_pos[(flag+8*4)>36?(flag+8*4 -36):flag+8*4][1]);
	
	
	
	
			//


}








 
//实现回调函数
static void my_event_cb(lv_event_t * event)
{
	
		printf("start scroll menu\r\n");
	#if 1
	//lv_dir_t  dir = lv_indev_get_gesture_dir(lv_indev_get_act());//获得手势的方向
	
	
	
		//timer=lv_timer_create(start_scroll_timer, 10,NULL);	  //创建定时器

	
	  //lv_indev_wait_release(indev); //等待释放
	
	
	#if 0
	
	  lv_indev_t * indev = lv_indev_get_act(); //获取当前的坐标
    if(indev == NULL)
		{
		//printf("null\r\n");
		//memset(&history_vect,0x00,sizeof(lv_point_t) *3 );
			return;
		}
		
	  //lv_indev_get_vect(indev, &vect);//获取当前移动向量
		lv_indev_get_point(indev, &vect);//获取当前的坐标
		
   lv_coord_t x =0;
   lv_coord_t y=0;
	
	 lv_coord_t  current_result; //计算当前的结果
		
		
		memcpy(&history_vect[Current_index],& vect,sizeof(lv_point_t) );
		
		
		
		
		Current_index++;
		if(Current_index >= 3)  //计算当前的滑动方向
		{
		  current_result=  ((history_vect[1].x -history_vect[0].x)*(history_vect[2].y -history_vect[1].y) ) -  ((history_vect[2].x -history_vect[1].x)*(history_vect[1].y -history_vect[0].y) ) ;
			memset(&history_vect,0x00,sizeof(lv_point_t)*3 );

			if(current_result>0)
			{
				flag++;	
			//顺时针
				printf("shun\r\n");
			}else
			{
			//逆时针
				flag--;	
				printf("ni\r\n");
				
			}
			
		}
		Current_index%=3;
		
		//lv_indev_wait_release(indev); //等待释放
			
	//lv_obj_set_pos(BP_img,bp_pos[0][0]        +vect.x		,bp_pos[0][1]  +vect.y);	
	//lv_obj_set_pos(message_img,bp_pos[4][0]   +vect.x		,bp_pos[4][1]  +vect.y);
	//lv_obj_set_pos(Calculator_img,bp_pos[8][0]+vect.x   ,bp_pos[8][1]  +vect.y);
	//lv_obj_set_pos(phone_img,bp_pos[12][0]    +vect.x		,bp_pos[12][1] +vect.y);
		

	lv_obj_set_pos(BP_img,						bp_pos[(flag+0*4)>36?(flag+0*4 -36):flag+0*4][0],bp_pos[(flag+0*4)>36?(flag+0*4 -36):flag+0*4][1]);
	lv_obj_set_pos(message_img,				bp_pos[(flag+1*4)>36?(flag+1*4 -36):flag+1*4][0],bp_pos[(flag+1*4)>36?(flag+1*4 -36):flag+1*4][1]);
	lv_obj_set_pos(Calculator_img,		bp_pos[(flag+2*4)>36?(flag+2*4 -36):flag+2*4][0],bp_pos[(flag+2*4)>36?(flag+2*4 -36):flag+2*4][1]);
	lv_obj_set_pos(phone_img,					bp_pos[(flag+3*4)>36?(flag+3*4 -36):flag+3*4][0],bp_pos[(flag+3*4)>36?(flag+3*4 -36):flag+3*4][1]);
	lv_obj_set_pos(weather_img,				bp_pos[(flag+4*4)>36?(flag+4*4 -36):flag+4*4][0],bp_pos[(flag+4*4)>36?(flag+4*4 -36):flag+4*4][1]);
	lv_obj_set_pos(music_img,					bp_pos[(flag+5*4)>36?(flag+5*4 -36):flag+5*4][0],bp_pos[(flag+5*4)>36?(flag+5*4 -36):flag+5*4][1]);
	lv_obj_set_pos(stop_watch_img,		bp_pos[(flag+6*4)>36?(flag+6*4 -36):flag+6*4][0],bp_pos[(flag+6*4)>36?(flag+6*4 -36):flag+6*4][1]);
	lv_obj_set_pos(outdoor_sport_img,	bp_pos[(flag+7*4)>36?(flag+7*4 -36):flag+7*4][0],bp_pos[(flag+7*4)>36?(flag+7*4 -36):flag+7*4][1]);
	lv_obj_set_pos(hr_img,						bp_pos[(flag+8*4)>36?(flag+8*4 -36):flag+8*4][0],bp_pos[(flag+8*4)>36?(flag+8*4 -36):flag+8*4][1]);
	
	#endif
	
	
	#if 0
	if(LV_DIR_RIGHT  == dir)  
	{
		
//		 x = lv_obj_get_x(task_obj) + vect.x;
//	  if(x>0)
//		{
//		   x=0;
//		}
//    y = lv_obj_get_y(task_obj);// + vect.y;
//    lv_obj_set_pos(task_obj, x, y);
		printf("LV_DIR_RIGHT\r\n");
	}else if(LV_DIR_LEFT  == dir)
	{
		
		
		lv_obj_set_pos(BP_img,bp_pos[0][0]    -vect.x			,bp_pos[0][1] - vect.y);	
		lv_obj_set_pos(message_img,bp_pos[4][0]-vect.x		,bp_pos[4][1]  -vect.y);
		lv_obj_set_pos(Calculator_img,bp_pos[8][0]-vect.x ,bp_pos[8][1]  -vect.y);
		lv_obj_set_pos(phone_img,bp_pos[12][0]-vect.x			,bp_pos[12][1] -vect.y);
		
//		x = lv_obj_get_x(task_obj) + vect.x;
//	  if(x<-150)
//		{
//		   x=-150;
//		}
//	
//    y = lv_obj_get_y(task_obj);
//    lv_obj_set_pos(task_obj, x, y);
		
	  printf("LV_DIR_LEFT\r\n");
	}else if(LV_DIR_TOP  == dir)
	{
	
		
//		x = lv_obj_get_x(menu_obj);
//	  if(y<-360)
//		{
//		   y=-360;
//		}
//    y = lv_obj_get_y(menu_obj)+ vect.y;
//    lv_obj_set_pos(menu_obj, x, y);
//		
//		
		  printf("LV_DIR_TOP\r\n"); 
		
		
	}else if(LV_DIR_BOTTOM  == dir)
	{
		
//		x = lv_obj_get_x(menu_obj);
//	  if(y>0)
//		{
//		   y=0;
//		}
//    y = lv_obj_get_y(menu_obj) + vect.y;
//    lv_obj_set_pos(menu_obj, x, y);
//		
//		
//		
	  printf("LV_DIR_BOTTOM\r\n");
	}
	#endif
	
  #endif

}


//static  lv_obj_t *  phone_img=NULL ;
//static  lv_obj_t *  weather_img=NULL ;
//static  lv_obj_t *  phone_img=NULL ;
//static  lv_obj_t *  weather_img=NULL ;
//static  lv_obj_t *  phone_img=NULL ;




void window_scroll_menu_init()
{
	  //LV_IMG_DECLARE(calc_menu);
    //LV_IMG_DECLARE(call_menu);
    //LV_IMG_DECLARE(contact_menu);
    //LV_IMG_DECLARE(main_menu);
    //LV_IMG_DECLARE(message_menu);
    //LV_IMG_DECLARE(music_menu);
    //LV_IMG_DECLARE(quit_menu);
    //LV_IMG_DECLARE(setting_menu);
//	  lv_obj_t * img1 = lv_img_create(window_manger[WINDOW_SCROLL_MENU].window_obj);
//		BP_img = lv_img_create(img1);
//    lv_img_set_src(BP_img, &quit_menu);
//		lv_obj_set_pos(BP_img,143,49);	
//	  lv_img_set_zoom(BP_img, 300); //设置图片缩放
//		
//		message_img = lv_img_create(img1);
//    lv_img_set_src(message_img, &menu_slide_Small_Stopwatch);
//		lv_obj_set_pos(message_img,21,167);
//		lv_img_set_zoom(message_img, 300); //设置图片缩放
//	
//		Calculator_img = lv_img_create(img1);
//    lv_img_set_src(Calculator_img, &menu_slide_Small_message);
//		lv_obj_set_pos(Calculator_img,37,221);
//		lv_img_set_zoom(Calculator_img, 200); //设置图片缩放	
//		
//		
//		phone_img		=	lv_img_create(img1);
//		lv_img_set_src(phone_img, &menu_slide_Small_message);
//		lv_obj_set_pos(phone_img,262,228);
//		
//	
//	  weather_img = lv_img_create(img1);
//    lv_img_set_src(weather_img, &contact_menu);
//		lv_obj_set_pos(weather_img,145,278);
//	
////	

//		music_img = lv_img_create(img1);
//    lv_img_set_src(music_img, &music_menu);
//		lv_obj_set_pos(music_img,278,160);
//		
		
		
		
		
//		
//		LV_IMG_DECLARE(power);
//		
//		 lv_obj_t * img;
//    img = lv_gif_create(lv_scr_act());
//    lv_gif_set_src(img, &power);
    //lv_obj_align(img, LV_ALIGN_LEFT_MID, 20, 0);
		
		
//	
//		stop_watch_img = lv_img_create(img1);
//    lv_img_set_src(stop_watch_img, &menu_slide_Small_Stopwatch);
//		lv_obj_set_pos(stop_watch_img,bp_pos[24][0],bp_pos[24][1]);
//	
//	
//	
//	

//		outdoor_sport_img = lv_img_create(img1);
//    lv_img_set_src(outdoor_sport_img, &menu_slide_Small_Outdoorsports);
//		lv_obj_set_pos(outdoor_sport_img,bp_pos[28][0],bp_pos[28][1]);
//		
//		
//		
//		hr_img= lv_img_create(img1);
//    lv_img_set_src(hr_img, &menu_slide_Small_hr);
//		lv_obj_set_pos(hr_img,bp_pos[32][0],bp_pos[32][1]);
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	


#if 0
    //LV_IMG_DECLARE(calc_menu);
    //LV_IMG_DECLARE(call_menu);
    //LV_IMG_DECLARE(contact_menu);
    //LV_IMG_DECLARE(main_menu);
    //LV_IMG_DECLARE(message_menu);
    //LV_IMG_DECLARE(music_menu);
    //LV_IMG_DECLARE(quit_menu);
    //LV_IMG_DECLARE(setting_menu);
	
	 
    lv_obj_t * img1 = lv_img_create(window_manger[WINDOW_SCROLL_MENU].window_obj);
		lv_obj_set_size(img1,360,360);
		BP_img = lv_img_create(img1);
    lv_img_set_src(BP_img, &menu_slide_Small_BP);
		lv_obj_set_pos(BP_img,bp_pos[0][0],bp_pos[0][1]);	
	
		
		message_img = lv_img_create(img1);
    lv_img_set_src(message_img, &menu_slide_Small_message);
		lv_obj_set_pos(message_img,bp_pos[4][0],bp_pos[4][1]);
		
		Calculator_img = lv_img_create(img1);
    lv_img_set_src(Calculator_img, &menu_slide_Small_Calculator);
		lv_obj_set_pos(Calculator_img,bp_pos[8][0],bp_pos[8][1]);
		
		
		
		phone_img		=	lv_img_create(img1);
		lv_img_set_src(phone_img, &menu_slide_Small_Phone);
		lv_obj_set_pos(phone_img,bp_pos[12][0],bp_pos[12][1]);
		
	
	  weather_img = lv_img_create(img1);
    lv_img_set_src(weather_img, &menu_slide_Small_weather);
		lv_obj_set_pos(weather_img,bp_pos[16][0],bp_pos[16][1]);
	
	

		 music_img = lv_img_create(img1);
    lv_img_set_src(music_img, &menu_slide_Small_music);
		lv_obj_set_pos(music_img,bp_pos[20][0],bp_pos[20][1]);
	
		stop_watch_img = lv_img_create(img1);
    lv_img_set_src(stop_watch_img, &menu_slide_Small_Stopwatch);
		lv_obj_set_pos(stop_watch_img,bp_pos[24][0],bp_pos[24][1]);
	
	
	
	

		outdoor_sport_img = lv_img_create(img1);
    lv_img_set_src(outdoor_sport_img, &menu_slide_Small_Outdoorsports);
		lv_obj_set_pos(outdoor_sport_img,bp_pos[28][0],bp_pos[28][1]);
		
		
		
		hr_img= lv_img_create(img1);
    lv_img_set_src(hr_img, &menu_slide_Small_hr);
		lv_obj_set_pos(hr_img,bp_pos[32][0],bp_pos[32][1]);
		
		lv_obj_add_flag(window_manger[WINDOW_SCROLL_MENU].window_obj,LV_OBJ_FLAG_CLICKABLE ); //增加可以长按的属性
		lv_obj_add_state(window_manger[WINDOW_SCROLL_MENU].window_obj,LV_STATE_PRESSED);
		
		
		//增加滑动处理函数
		lv_obj_add_event_cb(window_manger[WINDOW_SCROLL_MENU].window_obj,my_event_cb,LV_EVENT_PRESSING /*| LV_EVENT_RELEASED*/,NULL);   //添加对象回调函数
		
		
		//lv_obj_add_event_cb(window_manger[WINDOW_SCROLL_MENU].window_obj,release_event_cb,LV_EVENT_PRESS_LOST /*| LV_EVENT_RELEASED*/,NULL);   //添加对象回调函数

		
		
		
		//旋转动画
   	//timer=lv_timer_create(my_timer, 10,NULL);	  
		
		
		
		#if 0
		message_img = lv_img_create(img1);
    lv_img_set_src(message_img, &menu_slide_Small_message);
		lv_obj_set_pos(message_img,100,100);
		
		
		
		Calculator_img = lv_img_create(img1);
    lv_img_set_src(Calculator_img, &menu_slide_Small_Calculator);
		lv_obj_set_pos(Calculator_img,180,100);
			
		phone_img		=	lv_img_create(img1);
		lv_img_set_src(phone_img, &menu_slide_Small_Phone);
		lv_obj_set_pos(phone_img,260,100);
		
	
	  weather_img = lv_img_create(img1);
    lv_img_set_src(weather_img, &menu_slide_Small_weather);
		lv_obj_set_pos(weather_img,260,180);
	
	

		 music_img = lv_img_create(img1);
    lv_img_set_src(music_img, &menu_slide_Small_music);
		lv_obj_set_pos(music_img,180,180);
	
		stop_watch_img = lv_img_create(img1);
    lv_img_set_src(sleep_img, &menu_slide_Small_Stopwatch);
		lv_obj_set_pos(sleep_img,100,180);
	
	
	
	

		outdoor_sport_img = lv_img_create(img1);
    lv_img_set_src(o2_img, &menu_slide_Small_Outdoorsports);
		lv_obj_set_pos(o2_img,20,180);
		#endif
		
		

 #endif
}